<?php if (!defined('HKCMS_VERSION')) exit(); ?>
  <div class="table_list">
    <table width="100%">
      <thead>
        <tr>
          <td width="200">名称</td>
          <td width="100">标识</td>
          <td align="center">描述</td>
          <td align="center" width="100">作者</td>
          <td align="center" width="50">版本</td>
          <td align="center" width="227">操作</td>
        </tr>
      </thead>
      {volist name="data" id="vo"}
      <tr>
        <td><a href="{$vo.fullurl}" target="_blank">{$vo.title}</a></td>
        <td>{$vo.mark}</td>
        <td>{$vo.description}</td>
        <td align="center">{$vo.username}</td>
        <td align="center">{$vo.version|default='未知版本号'}</td>
        <td align="center">
          <?php
		  if(!model('Addons/Addons')->isInstall($vo['mark'])){
              if (!version_compare(HKCMS_VERSION,$vo['hkcms_version'],$vo['hkcms_version_op'])) {
                  echo '版本要求('.$vo['hkcms_version_op'].$vo['hkcms_version'].')';
              } else if($vo['price']>0){
                  if (!empty($vo['ispaid']) && $vo['ispaid']==1) {
                      echo '<a href="'.url('install',array('id'=>$vo['id'],'mark'=>$vo['mark'])).'" class="btn btn_submit mr5 Js_install">安装</a>';
                  } else {
                      echo "<a href='".$vo['fullurl']."' target='_blank' class=\"btn btn_submit\">购买</a><br /><font color=\"#FF0000\">价格：".$vo['price']." 元</font>";
                  }
              } else if ($vo['price']<=0) {
                  echo '<a href="'.url('install',array('id'=>$vo['id'],'mark'=>$vo['mark'])).'" class="btn btn_submit mr5 Js_install">安装</a>';
              }
		  }else{
			 //有安装，检测升级
			 if($vo['upgrade']){
				 echo '<a href="'.url('upgrade',array('id'=>$vo['id'],'sign'=>$vo['mark'])).'" class="btn btn_submit mr5 Js_upgrade" id="upgrade_tips_'.$vo['mark'].'">升级到最新'.$vo['newVersion'].'</a>';
			 }
		  }
		  ?>
         </td>
      </tr>
      {/volist}
    </table>
  </div>
  <div class="p10">
        <div class="pages">{$Page}</div>
   </div>